<script lang="ts">
	export let i: number, name: string, seclect: number, value: string;

	import { createEventDispatcher } from 'svelte';

	const dispatch = createEventDispatcher();

	function sayHello(x: number, y: string, z: string) {
		dispatch('message', {
			x,
			y,
			z
		});
	}
</script>

<button
	on:click={sayHello(i, value, name)}
	class={seclect == i
		? 'bg-purple-700 text-red-700 m-5'
		: 'bg-gray-200 text-black border-gray-600 border m-5'}>{name}</button
>
